#!/bin/sh -e

## Ascend init
cd /var/
/bin/bash /var/minirc_boot.sh /var/Ascend310B-hdk-npu-driver_22.0.3_euleros2.10.aarch64.run
if [ -e /var/minirc_hook.sh ];then
  /bin/bash /var/minirc_hook.sh >>/var/minirc_hook.log
fi

## Airemote model and applet services
#CLUSTER_HOSTS="192.168.1.7"
#runuser -l HwHiAiUser -c "/bin/bash /home/HwHiAiUser/DK200I/airstart.sh &"
/bin/bash /home/HwHiAiUser/DK200I/airstart.sh ${CLUSTER_HOSTS} &

## Jupyter notebook service
runuser -l HwHiAiUser -c "cd ~/airemote/jupyter-notebook&&jupyter notebook &"

## Running updates if available
if [ -x /root/air_update.sh ];then
  /bin/sh /root/air_update.sh
fi

## Ends
